package club.xcgame520.picturepicker.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 描述
 * <br/>
 * Created by 小灿 on 2016/12/6.
 */

public class Check implements Serializable {

    private boolean check;

    public Check(boolean check) {
        this.check = check;
    }

    public Check() {
    }

    public boolean isCheck() {
        return check;
    }

    public void setCheck(boolean check) {
        this.check = check;
    }

    @Override
    public String toString() {
        return "Check{" +
                "check=" + check +
                '}';
    }

    public static void singleCheck(List<Check> checks, int index, boolean isCheck) {
        for (int i = 0; i < checks.size(); i++) {
            checks.get(i).setCheck(!isCheck);
        }
        checks.get(index).setCheck(isCheck);
    }

    public static ArrayList<Check> createCheck(int size) {
        ArrayList<Check> checks = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            Check check = new Check();
            checks.add(check);
        }
        return checks;
    }
}
